home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre1.z / postgre1 / video / wholevideo.sh < prev   
Encoding:
Linux/UNIX/POSIX Shell Script  |  1992-08-27  |  940 b   |  36 lines

  1. #!/bin/sh
  2.  
  3. # $Header: /private/postgres/video/RCS/wholevideo.sh,v 1.2 1991/11/20 03:05:48 mer Exp $
  4. # This is a simple script used to run the entire video without having to
  5. # type all of those tedious include commands to the terminal monitor.
  6. # This script assumes that the postmaster is currently running.
  7. # NOTE:
  8. # It also assumes that you don't have a data base video in which you keep
  9. # important data (it destroys video if it exists then re-creates it to run
  10. # the postgres video queries).
  11.  
  12. datafile=/tmp/pgvideo.$$
  13.  
  14. if [ -d $POSTGRESHOME/data/base/video ]
  15. then
  16.     echo ===== destroying old video database... =====
  17.     destroydb video
  18. fi
  19.  
  20. echo ===== creating new video database... =====
  21. $POSTGRESHOME/bin/createdb video
  22.  
  23. rm -f $datafile
  24.  
  25. echo "retrieve (x=1) \g" > $datafile
  26.  
  27. for f in `cat video_order`
  28. do
  29.     cat $POSTGRESHOME/video/$f | sed -e 's/\\p/\\g/g' >> $datafile
  30. done
  31.  
  32. $POSTGRESHOME/bin/monitor video < $datafile
  33.  
  34. rm -f $datafile
  35.